Skip to content

Move the session key to config; add interim Java4Shell JVM flag - #3

Draft
lambduhh wants to merge 1 commit into
mainfrom
fix/java4shell-session-key
Draft

lambduhh wants to merge 1 commit into
mainfrom
fix/java4shell-session-key

Conversation

@lambduhh

@lambduhh lambduhh commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Session key from config. http.clj reads the cookie-store key from :http/session-cookie-key, set in the server's /home/compass/config.edn like the other secrets, instead of a literal in source. It's passed to Ring as bytes, the non-deprecated form. If unset, Ring picks a random key: sessions reset on restart, but the app keeps working.
  • Interim JVM flag. The unit in ops/cloud_init.sh starts the JVM with -J-XX:-UseBASE64Intrinsics, an interim mitigation for CVE-2026-114938 (OpenJDK advisory). Remove it once the JDK is 17.0.21.1 or later.
  • Records. A commented placeholder in prod.edn, and CHANGELOG entries.

Server steps (not covered by this PR)

  1. Set :http/session-cookie-key (16 characters) in /home/compass/config.edn.
  2. Add the flag to the live unit. cloud_init.sh only applies to new machines, so add -J-XX:-UseBASE64Intrinsics to /etc/systemd/system/compass.service, then run systemctl daemon-reload and restart.

Not done

I didn't run bin/kaocha: it needs the local services. The edited files parse, and the Ring 1.15.5 source confirms the key handling.

The cookie-store key was a literal in http.clj, so it is public in git
history. It now comes from :http/session-cookie-key in the server's
config.edn, passed to Ring as bytes (the non-deprecated form). Without it,
Ring uses a random key, so sessions reset on restart but the app runs.

cloud_init.sh starts the JVM with -XX:-UseBASE64Intrinsics, an interim
mitigation for CVE-2026-114938 until the JDK is 17.0.21.1 or later. Ring's
cookie store Base64-decodes every session cookie before checking its HMAC,
so the session cookie reaches the affected decoder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant